@import '../../../../../common/_utils/style/mixins/mixins.scss';
@import '../../../../../common/_utils/style/theme/theme.scss';
@import '../../../../../common/collapse-card/style/collapse-card.scss';
@import '../../../../../common/card/style/card.scss';
@import '../../../../../common/collapse/style/collapse.scss';

@include b(legend) {
  $legend-prefix: &;
  $card-prefix: #{$ant-prefix}-card;
  $collapse-prefix: #{$ant-prefix}-collapse;
  $card-collapse-prefix: #{$ant-prefix}-collapse-card;

  overflow-y: auto;
  border: none;
  min-width: 30px;
  min-height: 30px;
  .#{$card-collapse-prefix}__content {
    box-shadow: none;
    max-height: 400px;
  }
  .#{$card-prefix} {
    height: 100%;
    background: transparent;
    color: inherit;
    font-size: inherit;
  }
  .#{$card-prefix}-body {
    padding: 0px;
    height: 100%;
  }

  @include e(table) {
    border-top: none;
  }

  @include e(noBorder) {
    max-width: none;
    height: 100%;
    padding-right: 15px;
    border-bottom: 1px solid $border-color-split;
    margin-bottom: 5px;
    padding-bottom: 5px;
    &:last-child {
      border-bottom: none;
      margin-bottom: 0;
      padding-bottom: 0;
    }
    #{$legend-prefix}__title {
      padding-bottom: 10px;
    }
  }

  @include e(themefield) {
    padding-bottom: 10px;
  }

  .is-not-header {
    &.is-top-left,
    &.is-bottom-left {
      .#{$collapse-prefix} {
        .#{$collapse-prefix}-item {
          padding-left: 30px;
        }
        .#{$collapse-prefix}-content {
          margin-left: -30px;
        }
        .#{$collapse-prefix}-content-box {
          padding-left: 16px;
        }
      }
    }
    &.is-top-right,
    &.is-bottom-right {
      .#{$collapse-prefix} {
        .#{$collapse-prefix}-item {
          padding-right: 30px;
        }
        .#{$collapse-prefix}-content {
          margin-right: -30px;
        }
        .#{$collapse-prefix}-content-box {
          padding-right: 16px;
        }
      }
    }
  }

  @include e(panel) {
    .#{$collapse-prefix}-header {
      display: none;
    }
  }

  .#{$collapse-prefix} {
    border: 0;
    background: transparent;
    color: inherit;
    font-size: inherit;
    .#{$collapse-prefix}-item {
      border-bottom: none;
      padding: 0px 16px 0;
      &:last-child {
        .#{$collapse-prefix}-header {
          border-bottom: none;
          border-radius: 0;
        }
        &.#{$collapse-prefix}-item-active {
          .#{$collapse-prefix}-header {
            border-bottom: 1px solid $border-color-split;
          }
        }
      }
      .#{$collapse-prefix}-header {
        color: inherit;
        border-bottom: 1px solid $border-color-split;
        padding: 6px 0;
        line-height: 20px;
        .header-wrap {
          display: flex;
          align-items: center;
          justify-content: space-between;
          padding-right: 8px;
        }
      }
    }
  }
  .#{$collapse-prefix}-content {
    background: $collapse-card-secondary-bg;
    margin: 0 -16px;
    padding: 7px 16px;
    border-top: none;
    color: inherit;
    .#{$collapse-prefix}-content-box {
      padding: 0;
      @include e(wrap) {
        display: flex;
        align-items: center;
        height: 100%;
        min-width: 80px;
      }
      @include e(range) {
        overflow: hidden;
        @include e(range-item) {
          & > div {
            > i {
              display: inline-block;
              vertical-align: text-bottom;
              width: 14px;
              height: 14px;
            }
          }
        }
      }

      @include e(rank-icon) {
        & > i {
          display: inline-block;
          vertical-align: middle;
        }
      }

      @include e(heatbox) {
        display: flex;
        overflow: hidden !important;
        height: 120px;
      }

      @include e(heat) {
        height: 100%;
        > i {
          display: inline-block;
          width: 14px;
          height: 100%;
        }
      }
      @include e(heatText range-item rank-item) {
        span {
          i {
            font-size: inherit;
          }
        }
      }
      @include e(heatText) {
        display: flex;
        flex-direction: column;
        justify-content: space-between;
        height: 100%;
      }

      @include e(point) {
        padding: 0;
        margin: 0;
        &::-webkit-scrollbar-thumb {
          background: $scrollbar-background;
        }
      }

      @include e(heatbox item range-item rank-item) {
        margin-bottom: 8px;
        line-height: 20px;
        display: flex;
        align-items: center;
        > * {
          &:first-child {
            text-align: center;
          }
          &:last-child {
            width: auto;
            padding-left: 10px;
          }
        }
        &:last-child {
          margin-bottom: 0;
        }
      }

      @include e(item) {
        list-style: none;
        > i {
          font-size: 14px;
        }
      }

      @include e(field-value) {
        margin-left: 12px;
        max-width: 86%;
      }

      @include e(title) {
        width: 85%;
        & + i {
          font-size: inherit;
        }
      }
    }
  }
}
